fix(unparser): use to_rfc3339 for default TIMESTAMPTZ formatting#21295
Conversation
|
Seems solid, waiting for someone else to take another look |
|
🚀 |
|
Close/reopen PR to rerun checks |
Pull request was closed
|
This was the first PR that got merged using the new PR merge queue from @blaginin It seems to have gone really well |
|
🤔 but a bunch of the tests seem to have failed after merge to main 5b0938d
|
|
I think that's correct - Rust tests are not required-to-merge (and hence not ran by the merge queue yet) - only dev.yaml does. The plan is to wait for a few days and do the same operation for the rest of the CI For now, Rust checks should work as before ("push" not "merge group" checks) |
This could be a bit counterintuitive, but for now we can maybe monitor the CI and see how it goes |
Yeah, what i find counter intuitive is that the main commit list now looks like this commit failed CI: https://github.com/apache/datafusion
Looks like main is broken since we enabled the queue:
|
|
oh, that should be an easy fix! |
- Related to #21295 (comment) - Follow on to #21239 ## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->




Which issue does this PR close?
to_rfc3339forTIMESTAMPTZformatting #21294.Rationale for this change
The default
timestamp_with_tz_to_stringusesDateTime<Tz>.to_string(), which produces literals like2025-09-15 11:00:00 +00:00that are not supported by multiple dialects (e.g. DuckDB, BigQuery). Switching toto_rfc3339()produces valid ISO 8601 / RFC 3339 strings (e.g.2025-09-15T11:00:00+00:00) that are broadly compatible.What changes are included in this PR?
Dialect::timestamp_with_tz_to_stringimplementation fromdt.to_string()todt.to_rfc3339()timestamp_with_tz_to_stringoverrides fromDuckDBDialectandBigQueryDialect(they produced equivalent RFC 3339-compatible output via custom format strings)Are these changes tested?
Yes, existing tests in
unparser::expr::testshave been updated to reflect the new format.Manually verifying updated format supported by
PostgreSQL,MySQL,SQLite,DuckDBandBigQuery.Are there any user-facing changes?
Yes — timestamp-with-timezone literals are now formatted as RFC 3339 (
2025-09-15T11:00:00+00:00) instead of the previousDisplayformat (2025-09-15 11:00:00 +00:00). Dialects that need a different format can still overridetimestamp_with_tz_to_string.